package day3;

import java.util.*;

/**
 * @author oldliu
 * @since 1.0
 */
public class SetTest4 {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        list.add("你好");
        list.add("dog");
        list.add("tiger");
        list.add("123");
        list.add("老虎");
        String max = Collections.max(list);
        System.out.println("max=" + max);
        Collections.sort(list);
        System.out.println(list);
        System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>");
        Set<School> s = new HashSet<>();
        s.add(new School("合肥科海", "合肥", 7, 4));
        s.add(new School("杭州西湖中心", "杭州", 5, 4));
        s.add(new School("南京中博", "南京", 27, 14));
        s.add(new School("蚌埠原石", "蚌埠", 9, 9));
        s.add(new School("蚌埠原石", "合肥", 3, 6));
        School m = Collections.max(s);
        System.out.println("最大的是："+m);
        School min = Collections.min(s);
        System.out.println("最xiao的是："+min);
        List<School> list2=new ArrayList<>(s);
        //list2.addAll(s);
        Collections.sort(list2);
        System.out.println("排序后：");
        for(School sh:list2){
            System.out.println(sh);
        }
    }
}
